const {
    Schema,
    model
} = require('mongoose');
const moment = require('moment')

const remarksSchema = new Schema({
    carId: {
        type: Schema.Types.ObjectId,
        ref: 'Cars'
    },
    orderId: {
        type: Schema.Types.ObjectId,
        ref: 'Orders'
    },
    //租车人Id
    userId: {
        type: Schema.Types.ObjectId,
        ref: 'Users'
    },
    rateStatus: {
        type: String,
        default: "好评"
    },//评分情况  默认： “好评”
    info: {
        type: String,
        default: "用户没有填写任何评价"
    },//评分描述  默认： ‘’用户没有填写任何评价‘
    stars: {
        type: String,
        default: "500"
    },//评分星星  默认:500
    score: {
        type: String,
        default: "5.0"
    },//评分
    //下单时间
    time: {
        type: String,
        default: moment().format('YYYY年MM月DD日 HH:mm'),
    },
    money: Number,
}, {
    versionKey: false
});

const Remarks = model('Remarks', remarksSchema, 'remarks');
module.exports.Remarks = Remarks;